import { commonBaseUrl } from '@/utils'
import request from '@/utils/request'

const moduleName = commonBaseUrl('C') || 'acceptance/'

// 按钮能源适配接口
export function getCommonBtnInfo(data) {
  return request({
    url: moduleName + 'api/accept/commonAcceptance/getAcceptButtonList',
    method: 'post',
    data
  })
}
// 是否配置会签
export function getIsDeployCountersignature(data) {
  return request({
    url: moduleName + 'api/accept/acceptanceVerification/getCounterSignFlowDisplayed',
    method: 'post',
    data
  })
}
// 维护改造开工完工
export function getStartEndWork(params) {
  return request({
    url: moduleName + 'api/accept/commonAcceptance/syncProjectConState',
    method: 'get',
    params
  })
}
// 获取项目基本信息
export function getPrjDetailApi(prjId) {
  return request({
    url: moduleName + 'api/accept/commonAcceptance/getAcceptPrjInfo?prjId=' + prjId,
    method: 'get'
  })
}
// 获取验收时间
export function getAcceptAllTime(prjId) {
  return request({
    url: moduleName + 'api/accept/commonAcceptance/getAcceptAllTime?prjId=' + prjId,
    method: 'get'
  })
}
// 获取校验列表
export function getVerificationListApi(data) {
  return request({
    url: moduleName + 'api/accept/acceptanceVerification/queryVerificationList',
    method: 'post',
    data,
    showLoading: true
  })
}
// 校验
export function executeVerificationApi(data) {
  return request({
    url: moduleName + 'api/accept/acceptanceVerification/executeVerification',
    method: 'post',
    hideMessage: true,
    data
  })
}
// 内部验收表单校验
export function executeVerificationAccFormApi(data) {
  return request({
    url: moduleName + 'api/accept/acceptanceVerification/executeVerificationAccForm',
    method: 'post',
    data
  })
}
// 弱校验后更新数据
export function executeFailureToUpdateApi(data) {
  return request({
    url: moduleName + 'api/accept/acceptanceVerification/executeFailureToUpdate',
    method: 'post',
    data
  })
}
// 保存时间
export function updateAcceptTimeApi(data) {
  return request({
    url: moduleName + 'api/accept/commonAcceptance/updateAcceptInformation',
    method: 'post',
    data
  })
}
export function getGoToApi(url, params) {
  return request({
    url: moduleName + `api/accept/acceptanceVerification/${url}`,
    method: 'get',
    params,
    showLoading: true
  })
}
// 支持批量 资源确认
export function getGoToMultiplApi(url, data) {
  return request({
    url: moduleName + `api/accept/resourceConfirmBatch`,
    method: 'post',
    data
  })
}
export function getGoToMateApi(url, params) {
  return request({
    url: moduleName + `api/accept/pushResourceMateAndEntry`,
    method: 'post',
    params,
    showLoading: true
  })
}
// 资源录入 资源确认支持多个
export function getGoToMultipleMateApi(url, data) {
  return request({
    url: moduleName + `api/accept/pushResourceMateAndEntryBatch`,
    method: 'post',
    data,
    showLoading: true
  })
}
export function beforeProdBindCheckApi(data) {
  return request({
    url: commonBaseUrl('D') + `api/bind/product/beforeProdBindCheck`,
    method: 'post',
    data
  })
}
export function startSubAccProcessApi(params) {
  return request({
    url: moduleName + `api/accept/startSubAccProcess`,
    method: 'post',
    params
  })
}
export function doNextBatchFLowApi(data) {
  return request({
    url: moduleName + `api/accept/doNextBatchFLow`,
    method: 'post',
    showLoading: true,
    data
  })
}
export function getPurchaseServiceListApi(data) {
  return request({
    url: moduleName + `api/accept/commonAcceptance/getPurchaseServiceList`,
    method: 'post',
    data
  })
}
export function getDivideChangeApi(data) {
  return request({
    url: moduleName + `api/accept/commonAcceptance/getDivideChange`,
    method: 'post',
    data
  })
}
export function getDesOrSpvDivideApi(params) {
  return request({
    url: moduleName + `api/accept/commonAcceptance/getDesOrSpvDivide`,
    method: 'get',
    params
  })
}
export function threeSingleMatchApi(params) {
  return request({
    url: moduleName + `api/accept/commonAcceptance/threeSingleMatch`,
    method: 'get',
    params
  })
}
export function insertDivideChangeLogApi(data) {
  return request({
    url: moduleName + `api/accept/commonAcceptance/insertDivideChangeLog`,
    method: 'post',
    data
  })
}
export function queryProductInfoListByParamApi(data) {
  return request({
    url: commonBaseUrl('D') + `api/bind/product/queryProductInfoListByParam`,
    method: 'post',
    data
  })
}

export function getServiceDetailConfigApi(data) {
  return request({
    url: commonBaseUrl('D') + `/api/service/serviceDetailConfig/getServiceDetailConfig`,
    method: 'post',
    data
  })
}
export function queryServInfoListByParamApi(data) {
  return request({
    url: commonBaseUrl('D') + `api/insVa/module/queryServInfoListByParam`,
    method: 'post',
    data
  })
}
export function getSiteListApi(data) {
  return request({
    url: moduleName + `api/accept/commonAcceptance/getSiteList`,
    method: 'post',
    data
  })
}
export function getProSerBindingStateApi(data) {
  return request({
    url: commonBaseUrl('D') + `api/bind/product/getProSerBindingState`,
    method: 'post',
    data
  })
}
export function checkSerDetailsConfigApi(data) {
  return request({
    url: commonBaseUrl('D') + `api/service/externalServiceDetail/checkSerDetailsConfig`,
    method: 'post',
    data
  })
}

// 获取查看物资编码集合
export function getMaterialCodeList(data) {
  return request({
    url: commonBaseUrl('D') + `api/pub/material/getPrjCodeList`,
    method: 'post',
    data
  })
}
// 获取物资表格总览
export function getMaterialInfo(params) {
  return request({
    url: commonBaseUrl('D') + `api/pub/material/getMaterialAndServiceInfo`,
    method: 'get',
    params
  })
}
// 研发类资源录入
export function getGoToMateDevelopmentApi(prjId) {
  return request({
    url: moduleName + `api/accept/getResourceEntryURL?prjId=${prjId}`,
    method: 'post'
  })
}

// 维护专业资源确认显示设备变更弹窗
export function getShowEquipmentChangeApi(data) {
  return request({
    url: moduleName + `api/accept/acceptanceVerification/getFsuEquipmentChange`,
    method: 'post',
    data
  })
}

// 综合查询维护专业资源确认显示设备变更弹窗
export function getShowQueryFsuEquipmentApi(data) {
  return request({
    url: moduleName + `api/accept/acceptanceVerification/comprehensiveQueryFsuEquipment`,
    method: 'post',
    data
  })
}

// 设备变更弹窗获取列表数据
export function getEquipmentChangeDetailsApi(data) {
  return request({
    url: moduleName + `api/accept/acceptanceVerification/getFsuEquipmentChangeDetails`,
    method: 'post',
    data
  })
}

// 设备变更弹窗备注更新
export function updateFsuEquipmentChangeRemark(data) {
  return request({
    url: moduleName + `api/accept/acceptanceVerification/updateFsuEquipmentChangeRemake`,
    method: 'post',
    data
  })
}


// 验收&交维表格信息
export function queryYsAndJwTableList(data) {
  return request({
    url: moduleName + `api/accept/handover/queryYsAndJwTableList`,
    method: 'post',
    data,
    showLoading: true
  })
}

// 跳转其它系统地址
export function getMonitorAlarmVerifyDeviceUrl(params) {
  return request({
    url: moduleName + `api/accept/acceptanceVerification/getMonitorAlarmVerifyDeviceUrl`,
    method: 'get',
    params,
    showLoading: true
  })
}
export function getMonitorAlarmVerifyDeviceUrlB(params) {
  return request({
    url: moduleName + `api/accept/acceptanceVerification/getResourceVerifyDeviceUrl`,
    method: 'get',
    params,
    showLoading: true
  })
}
// 获取弹框表单信息
export function getHandoverInfoForm(data) {
  return request({
    url: moduleName + `api/accept/handover/getHandoverInfo`,
    method: 'post',
    data,
    showLoading: true
  })
}
// 查看版本记录信息
export function getHandoverVersionInfo(data) {
  return request({
    url: moduleName + `api/accept/handover/queryHandoverVersionList`,
    method: 'post',
    data,
    showLoading: true
  })
}

// 保存物业表单信息
export function saveHandoverInfo(data) {
  return request({
    url: moduleName + `api/accept/handover/saveHandoverInfo`,
    method: 'post',
    data,
    showLoading: true
  })
}

// 更新物业表单信息
export function updateHandoverInfo(data) {
  return request({
    url: moduleName + `api/accept/handover/updateHandoverInfo`,
    method: 'post',
    data,
    showLoading: true
  })
}

// 整改问题选人
export function getSelectUser(data) {
  return request({
    url: moduleName + `api/accept/startRectificationFlow`,
    method: 'post',
    data,
    showLoading: true
  })
}
// RT1节点 下一步确认选人
export function getSelectUserNextRT(data) {
  return request({
    url: moduleName + `api/accept/doNextRectFLow`,
    method: 'post',
    data,
    showLoading: true
  })
}
// F12校验是否打开整改问题清单
export function getIsOpenRectification(params) {
  return request({
    url: moduleName + `api/accept/handover/checIfExistsIssueInfo`,
    method: 'get',
    params,
    showLoading: true
  })
}